/* eslint valid-jsdoc: "off" */

"use strict";

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = (appInfo) => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = (exports = {});

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + "_1650348029437_2868";

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  // 关闭防火墙 接收post请求传递的参数
  config.security = {
    csrf: {
      enable: false,
    },
  };

  // 配置数据库
  config.mysql = {
    client: {
      host: "localhost",
      port: 3306,
      user: "root",
      password: "978158",
      database: "后台管理系统",
    },
  };

  // 开启文件识别
  config.multipart = {
    mode: "file",
  };

  //配置支付信息
  config.payConfig = {
    // 沙箱环境的appId
    appId: "2021000119697110",
    // 私钥
    privateKey:
      "MIIEowIBAAKCAQEAuuZU5b+UbMqODN+LcS355LkF8AYuXCol4LbfrmwZLqU+QbGrvXzjgFalmLoH3JoogcZWhIAUvDSlu2miII3mvOMPiOtczf5t7P/9Z3TysD6tW1/gAhOua1y1+6aoBVyw8Mjgwg4IX9rHvCO9xeHyCyThcQXGjP3SayavUSh38J75rbUYKrnK9cFAAUnWbGwntWATh4V7y9dzGZ+6TocBGC+3YBF6tGkM8x5KxolKb0RiqmZE+SMnntxJ+fyliPV6tfOzx1HkhBA6fxJ7h2Hq77Srux7YLI/SjaKcohk2CLlSkN8T4XzLoEA++CSbbjxvGjCeG60G86i0k/KW4bkAxQIDAQABAoIBACfXBW3cArWWD+WqmTzNAiHBVwStLKC001ItaUzy+gM5ciXqy6MexhgLYE1ICnj523yeXL7t1n2v80wZ3ld2KCNHe35CPYwjmicVAl1VTo5HLgj2TPfkXh/AqYI1KkfKVGVfTJnRB/P23PC75a4S1deOSwgepQ5U5M+2dVSlfbuqqVzb2ngAZMP7tLMEZkZtkmBoNDsp+3xD9FGjkf9n+0KyoNkmtKLK7L/TWQAli2wbXiaAgXun1S2xhRbttrkOsWlTR8+ioBxAKRy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GrvXzjgFalmLoH3JoogcZWhIAUvDSlu2miII3mvOMPiOtczf5t7P/9Z3TysD6tW1/gAhOua1y1+6aoBVyw8Mjgwg4IX9rHvCO9xeHyCyThcQXGjP3SayavUSh38J75rbUYKrnK9cFAAUnWbGwntWATh4V7y9dzGZ+6TocBGC+3YBF6tGkM8x5KxolKb0RiqmZE+SMnntxJ+fyliPV6tfOzx1HkhBA6fxJ7h2Hq77Srux7YLI/SjaKcohk2CLlSkN8T4XzLoEA++CSbbjxvGjCeG60G86i0k/KW4bkAxQIDAQAB", // 支付宝公钥（不是应用公钥）
    // 签名类型
    signType: "RSA2", // RSA2
    gateway: "https://openapi.alipaydev.com/gateway.do", // 网关地址
    timeout: 5000, // 网关超时时间
    camelcase: true, // 是否把网关返回的下划线 key 转换为驼峰写法
  };

  return {
    ...config,
    ...userConfig,
  };
};
